import 'package:flutter/material.dart';
import 'package:flutter_cwhisky/common/style/colors.dart';
import 'package:flutter_cwhisky/component/image_view.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../../bean/mall_home_entity.dart';

class ScotlandPrefectureComponent extends StatelessWidget {
  final MallHomeDataPrefecture prefecture;
  List icons = const [
    "https://img.cwhisky.com/home/ic_england_1%402x.png",
    "https://img.cwhisky.com/home/ic_england_2%402x.png",
    "https://img.cwhisky.com/home/ic_england_3%402x.png",
    "https://img.cwhisky.com/home/ic_england_4%402x.png",
    "https://img.cwhisky.com/home/ic_england_5%402x.png",
    "https://img.cwhisky.com/home/ic_england_6%402x.png"
  ];

  ScotlandPrefectureComponent({Key? key, required this.prefecture}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        children: [
          Flexible(
              child: Container(
            alignment: Alignment.topRight,
            child: Column(
              children: [
                _buildItem(0, 4.r),
                _buildItem(2, 27.r),
                _buildItem(4, 33.r),
              ],
            ),
          )),
          Container(
            width: 160.r,
            decoration: const BoxDecoration(image: DecorationImage(image: AssetImage('assets/images/bg_mall_scotland.png'))),
          ),
          Flexible(
              child: Container(
            alignment: Alignment.topLeft,
            child: Column(
              children: [
                _buildItem(1, 4.r),
                _buildItem(3, 27.r),
                _buildItem(5, 33.r),
              ],
            ),
          )),
        ],
      ),
    );
  }

  _buildItem(int index, double top) {
    return Container(
      margin: EdgeInsets.only(top: top, left: 1, right: 1),
      child: ImageView(
        url: icons[index],
        width: 65.r,
        height: 58.r,
      ),
    );
  }
}
